import java.util.Arrays;

public class ArraysTest {
    public static void main(String[] args) {
        int[] arr = new int[]{10, 20, 30, 40, 50};
        System.out.println(Arrays.toString(arr)); //打印
        int[] arr2 = new int[5];
        Arrays.fill(arr2, 10);//填充
        System.out.println(Arrays.toString(arr2));
        int[] arr3 = {10, 10, 10, 10, 10};
        System.out.println(Arrays.equals(arr2, arr3));//比较是否相同
        int[] arr4 = {3, 6, 1, 8, 9, 6};
        Arrays.sort(arr4); //排序
        System.out.println(Arrays.toString((arr4)));
        System.out.println(Arrays.binarySearch(arr4, 6));//查找元素的下标

        int[][] arr5 = new int[][]{{1, 2}, {2, 3}};
        for (int i = 0; i < arr5.length; i++) {
            for (int j = 0; j < arr5[i].length; j++) {
                System.out.println(arr5[i][j]);
            }
        }
    }
}
